import { $http } from "@escook/request-miniprogram";
import { useUserStore} from "../store/user";
const userStore = useUserStore()


// 获取药品列表
export function getMedicineList(page,pageSize) {

  console.log(userStore.getUserToken);
  
  return
    return uni.$http.get('/user/drug/list', {
      page:page,
      pageSize:pageSize
    },{
      header: {
        'Content-Type': 'application/json', // 设置请求头
        'authentication': userStore.getUserToken // 如果需要认证，可以添加 token
      }
    })
}

export function deleteMedicine(id){
  console.log('处理删除' + id);
}

export function addMedicine(medicine){
  console.log(medicine);
  return
  const res = uni.request({
    url: 'YOUR_BACKEND_API_URL/medicine', // 替换为您的后端API地址
    method: 'POST',
    data: medicineData
  });
}

export function saveDrugGroup(group){
  console.log(group);
  console.log('保存药品组合');
  
}